package com.lww.feature.test.stream;

import com.sun.javafx.scene.control.skin.VirtualFlow;
import org.junit.Test;

import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
 * User: yian
 * Date: 2017/7/9
 */
public class tomap {

    @Test
    public void testSort() {
        List<Integer> integers1 = Arrays.asList(1, 2, 3, 4);
        Map<Integer, Integer> map1 = integers1.stream().collect(Collectors.toMap(p -> p, p -> p * 2));
        System.out.println(map1);
        System.out.println("====================");
        List<Integer> integers2 = new ArrayList<>();
        Map<Integer, Integer> map2 = integers2.stream().collect(Collectors.toMap(p -> p, p -> p * 2));
        System.out.println(map2);


    }
}
